<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class e_class extends Model
{
    public $table = 'e_class';
    public $timestamps = false;
    protected $fillable = [];
    public $primaryKey = "id";


    protected function getOne($punch_id){
        $punch_info = punch_activity::where(['id'=>$punch_id])->first();
        return $punch_info;
    }


    protected function lists($openid, $page)
    {
        $pageSize = 8;
        $offset = ($page-1)*$pageSize;
        $res = $this->where('is_del', 0)
            ->where('openid',$openid)
            ->take($pageSize)->skip($offset)
            ->get()->toArray();
        return $res;
    }
}
